words = []

def find_word(word):
    for entry in words:
        if entry['word'] == word:
            print(f"单词: {entry['word']}, 注释: {entry['note']}")
            return
    print("单词未找到")

def add_word(word, note):
    for entry in words:
        if entry['word'] == word:
            print("单词已存在")
            return
    words.append({'word': word, 'note': note})
    print("单词已添加")

def display_words():
    if not words:
        print("字典为空")
        return
    for entry in words:
        print(f"单词: {entry['word']}, 注释: {entry['note']}")

def main():
    while True:
        print("\n请选择操作:")
        print("1. 显示所有单词")
        print("2. 查找单词")
        print("3. 增加单词")
        print("4. 退出")
        choice = input("请输入选项: ")

        if choice == '1':
            display_words()
        elif choice == '2':
            word = input("请输入要查找的单词: ")
            find_word(word)
        elif choice == '3':
            word = input("请输入要添加的单词: ")
            note = input("请输入单词的注释: ")
            add_word(word, note)
        elif choice == '4':
            print("退出程序")
            break
        else:
            print("无效选项，请重新输入")


main()
